#include <stdio.h>
void remove_filename(char *url);
int main(void)
{
    char url[] = "http://www.knking.com/index.html";
    remove_filename(url);
    puts(url);
    return 0;
}
void remove_filename(char *url) {
    char *s = url;
    while (*s)
        s++;
    while (*s != '/')
        s--;
    *s = '\0';
}